package com.ynsj.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ynsj.domain.SysPrivilege;
import com.ynsj.domain.SysUserLog;
import com.ynsj.model.R;
import com.ynsj.service.SysUserLogService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;

@RestController
@Api("系统日志")
@RequestMapping("/sysUserLog")
public class SysUserLogController {

    @Autowired
    private SysUserLogService sysUserLogService;

    /**
     * 查询系统日志-分页
     * @param privilegePage
     * @return
     */
    @GetMapping
    @ApiOperation("查询系统日志-分页")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "current",value = "当前页"),
            @ApiImplicitParam(name = "size",value = "每页显示的大小")
    })
    public R<Page<SysUserLog>> findByPage(@ApiIgnore Page<SysUserLog> privilegePage){
        return R.ok(sysUserLogService.findSysUserLogPage(privilegePage));
    }
}
